1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 interface UseAllBytecodesInterface
35 {
36 public void test_an_interface(int p1);
37 }
38
39 public class UseAllBytecodes implements UseAllBytecodesInterface
40 {
41 public int i1, i2;
42 public float f1, f2;
43 public double d1, d2;
44 public long l1, l2;
45
46 public static int si1, si2;
47 public static float sf1, sf2;
48 public static double sd1, sd2;
49 public static long sl1, sl2;
50
51 public UseAllBytecodesInterface interfaceObject;
52
53 public int multi[][][];
54
55 public UseAllBytecodes()
56 {
57
58
59 set_i1(11);
60 set_i2(22);
61 set_f1(1.1f);
62 set_f2(2.2f);
63 set_d1(1.0);
64 set_d2(2.0);
65 set_l1(3);
66 set_l2(4);
67
68 set_si1(33);
69 set_si2(44);
70 set_sf1(3.3f);
71 set_sf2(4.4f);
72 set_sd1(3.0);
73 set_sd2(4.0);
74 set_sl1(5);
75 set_sl2(6);
76
77 test_areturn();
78 test_athrow1();
79 test_athrow2();
80 test_athrow3();
81 test_athrow4();
82
83
84 interfaceObject.test_an_interface(1234);
85
86
87 multi = new int[2][3][4];
88 }
89
90 public UseAllBytecodes(int p1)
91 {
92 i1 = p1;
93 i2 = 12345678;
94 d1 = (double) p1;
95 d2 = 1.2e234;
96 }
97
98 public UseAllBytecodes(int p1, int p2)
99 {
100 i1 = p1;
101 i2 = p2;
102 }
103
104
105
106
107 public int set_i1(int p1)
108 {
109 i1 = p1;
110 return i1 + 1;
111 }
112
113 public int set_i2(int p2)
114 {
115 i2 = p2;
116 return i2 + 1;
117 }
118
119 public float set_f1(float p1)
120 {
121 f1 = p1;
122 return f1 + 1.0e34f;
123 }
124
125 public float set_f2(float p2)
126 {
127 f2 = p2;
128 return f2 + 1.0e34f;
129 }
130
131 public double set_d1(double p1)
132 {
133 d1 = p1;
134 return d1 + 1.0e234;
135 }
136
137 public double set_d2(double p2)
138 {
139 d2 = p2;
140 return d2 + 1.0e234;
141 }
142
143 public long set_l1(long p1)
144 {
145 l1 = p1;
146 return l1 + 1;
147 }
148
149 public long set_l2(long p2)
150 {
151 l2 = p2;
152 return l2 + 1;
153 }
154
155 public static void set_si1(int p1)
156 {
157 si1 = p1;
158 }
159
160 public static void set_si2(int p2)
161 {
162 si2 = p2;
163 }
164
165 public static void set_sf1(float p1)
166 {
167 sf1 = p1;
168 }
169
170 public static void set_sf2(float p2)
171 {
172 sf2 = p2;
173 }
174
175 public static void set_sd1(double p1)
176 {
177 sd1 = p1;
178 }
179
180 public static void set_sd2(double p2)
181 {
182 sd2 = p2;
183 }
184
185 public static void set_sl1(long p1)
186 {
187 sl1 = p1;
188 }
189
190 public static void set_sl2(long p2)
191 {
192 sl2 = p2;
193 }
194
195 public UseAllBytecodes test_areturn()
196 {
197 return this;
198 }
199
200
201
202 public void test_an_interface(int p1)
203 {
204 i1 = p1;
205 }
206
207
208
209 public static void test_athrow1() throws NullPointerException
210 {
211 try
212 {
213 si1 = -1;
214 throw new NullPointerException();
215 }
216 catch (Exception e)
217 {
218 si1 = 1;
219 }
220 }
221
222 public static void test_athrow2()
223 {
224 int i = 1;
225 try
226 {
227 si1 = -1;
228 test_athrow1();
229 }
230 catch (Exception e)
231 {
232
233
234 si1 = i + 1;
235 }
236 }
237
238 public static void test_athrow3()
239 {
240 int i = 1;
241 try
242 {
243
244 si1 = -1;
245 si2 = -1;
246 test_athrow5();
247 }
248 catch (NullPointerException np)
249 {
250 si1 = i + 1;
251 }
252 catch (NoSuchMethodException e)
253 {
254 si2 = i + 1;
255 }
256 si1++;
257 }
258
259 public static void test_athrow4()
260 {
261 int i = 2;
262 try
263 {
264
265 si1 = -1;
266 si2 = -1;
267 test_athrow7();
268 }
269 catch (NullPointerException e)
270 {
271 si1 = i + 1;
272 }
273 catch (NoSuchMethodException nsm)
274 {
275 si2 = i + 1;
276 }
277 si2++;
278 }
279
280 public static void test_throw_nosuchmethod() throws NoSuchMethodException
281 {
282 throw new NoSuchMethodException();
283 }
284
285 public static void test_throw_nullpointer() throws NullPointerException
286 {
287 throw new NullPointerException();
288 }
289
290 public static void test_athrow5() throws NullPointerException, NoSuchMethodException
291 {
292 test_athrow6();
293 }
294
295 public static void test_athrow6() throws NullPointerException, NoSuchMethodException
296 {
297 test_throw_nullpointer();
298 }
299
300 public static void test_athrow7() throws NullPointerException, NoSuchMethodException
301 {
302 test_athrow8();
303 }
304
305 public static void test_athrow8() throws NullPointerException, NoSuchMethodException
306 {
307 test_throw_nosuchmethod();
308 }
309 }